package View;

/**
 * Classe responsavel pelo conteudo exibido na tela de MENU.
 * 
 * @author Edjane Catolle, Igor Henrique, Luiz Augusto, Vladmir Chicarolli
 * @version 1.0.0
 * @since 05/31/2011
 */

import java.awt.Point;

import Model.ImagesManager;

public class MenuView extends BaseView
{

	private int currentMenuState;
	private static final int NEW_GAME 	= 	0;
	private static final int HELP 		= 	1;
	private static final int CREDITS 	= 	2;
	private static final int EXIT 		= 	3;
	
	public MenuView()
	{
		super();
	}
	
	@Override
	public void DrawHandler() 
	{
		if(currentMenuState == NEW_GAME)
		{
			buffer = ImagesManager.LoadImage(ImagesManager.newGameOnSRC);
		}
		else{
			buffer = ImagesManager.LoadImage(ImagesManager.newGameOffSRC);
		}
		CenterImage(new Point(0, ((buffer.getHeight(null) / 2)* - 3)));		
		DrawBuffer();
		
		if(currentMenuState == HELP)
		{
			buffer = ImagesManager.LoadImage(ImagesManager.helpOnSRC);
		}
		else{
			buffer = ImagesManager.LoadImage(ImagesManager.helpOffSRC);
		}
		CenterImage(new Point(0, ((buffer.getHeight(null) / 2)* - 1)));;
		DrawBuffer();
		
		
		if(currentMenuState == CREDITS)
		{
			buffer = ImagesManager.LoadImage(ImagesManager.creditsOnSRC);
		}
		else{
			buffer = ImagesManager.LoadImage(ImagesManager.creditsOffSRC);
		}
		CenterImage(new Point(0, (buffer.getHeight(null) / 2)));
		DrawBuffer();
		
		
		if(currentMenuState == EXIT)
		{
			buffer = ImagesManager.LoadImage(ImagesManager.exitOnSRC);
		}
		else{
			buffer = ImagesManager.LoadImage(ImagesManager.exitOffSRC);
		}
		CenterImage(new Point(0, (buffer.getHeight(null) / 2) * 3));
		DrawBuffer();
	}
	
	/**
	 * Set the current menu state. Used to make the roll over effect to the
	 * menu options.
	 * @param state - The current state from the menu.
	 */
	public void setMenuState(int state)
	{
		currentMenuState = state;
	}
}
